﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Services;

namespace farming.Menus
{
    [ApiExplorerSettings(GroupName = "v1")]
    public class MenuService : ApplicationService
    {
        /// <summary>
        /// 获取全部路由
        /// </summary>
        /// <returns></returns>
        [HttpGet("/Menu/Routes")]
        public async Task<ResultDto<List<MenuDto>>> Routes()
        {

            return new ResultDto<List<MenuDto>>
            {
                Code = ResultState.Success,
                Message = ""
            ,
                Data = new List<MenuDto>
                {
                    /*new MenuDto{
                        Name = "/system",
                        Path = "/system",
                        Component = "Layout",
                        Redirect = "/system/user",
                        Meta = new Meta
                        {
                            Title = "系统管理",
                            Icon = "system",
                            Hidden = false,
                            Roles = new string[]{ "GUEST", "ADMIN", "ADMIN6"}
                        },
                        Children = new List<MenuDto>
                        {
                            new MenuDto
                            {
                                Name = "User",
                                Path = "user",
                                Component = "system/user/index",
                                Meta = new Meta
                                {
                                    Title = "用户管理",
                                    Icon = "user",
                                    Hidden = false,
                                    KeepAlive = true,
                                    Roles = new string[]{ "GUEST", "ADMIN", "ADMIN6"}
                                },
                                Children = null
                            },
                            new MenuDto
                            {
                                Name = "Role",
                                Path = "role",
                                Component = "system/role/index",
                                Meta = new Meta
                                {
                                    Title = "角色管理",
                                    Icon = "role",
                                    Hidden = false,
                                    KeepAlive = true,
                                    Roles = new string[]{ "GUEST", "ADMIN", "ADMIN6"}
                                },
                                Children = null

                            }
                        }
                    }*/
                }
            };
        }
    }
}
